#ifndef COMBOBOXDELEGATE_H
#define COMBOBOXDELEGATE_H

#include <QStyledItemDelegate>

class ComboBoxDelegate : public QStyledItemDelegate
{
    Q_OBJECT
    QStringList *mItems;
public:
    ComboBoxDelegate(QObject *parent = 0);
    ComboBoxDelegate(const QStringList& items, QObject *parent = 0);
    ~ComboBoxDelegate();
    QString displayText(const QVariant &value, const QLocale &locale) const;
    QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
};

#endif // COMBOBOXDELEGATE_H
